<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>表单自动验证</title>
</head>
<body>
<form action="demo_form.php" method="post">
    <input type="text" name="fname" required="required">
    <input type="submit" value="提交">
</form>

<p>点击提交按钮，如果输入框时空的，浏览器会提示错误信息。</p>

</body>
</html>